package com.xm.servlet.background.commodity;

import com.xm.service.background.CommoditySpecificationService;
import lombok.SneakyThrows;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 删除指定商品规格
 * @author 康文程
 * @date 2024-1-17 下午 07:05
 */
@WebServlet("/background/delete/commodity/specification/by/id")
public class DeleteCommoditySpecificationByIds extends HttpServlet {
    private final CommoditySpecificationService service = new CommoditySpecificationService();

    @SneakyThrows
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) {
        String specificationId = req.getParameter("specificationId");
        String commodityId = req.getParameter("commodityId");
        System.out.println(commodityId);
        System.out.println(specificationId);
        resp.getWriter().print(
                service.deleteCommoditySpecificationByIds(
                        Integer.parseInt(specificationId),Integer.parseInt(commodityId)));
    }
}
